<?php
require('common_view_functions.php');

function get_avatar_name($user_id, $rand = FALSE) {
	$fn = $_SERVER['DOCUMENT_ROOT'] . '/img/avatars/avt_' . $user_id . '_48x48.jpg';
	if(file_exists($fn)) {
		if($rand) {
			return 'avt_' . $user_id . '_48x48.jpg?R=' . rand();
		} else {
			return 'avt_' . $user_id . '_48x48.jpg';
		}
	} else {
		return 'avt_-1_48x48.jpg';
	}
}
?><table cellspacing="0">
	<?php foreach($sub_list as $sl) { ?>
	<tr<?php if($sl->updated == 1) { ?> class="new"<?php } ?>>
		<td class="avt"><img alt="" class="msg_avatar" src="/img/avatars/<?php echo(get_avatar_name($sl->blogger_id)); ?>" /></td>
		<td class="ttl">
			<a href="<?php echo('/' . $sl->user_url . '/entry/' . $sl->entry_id); ?>"><?php echo(htmlspec($sl->title)); ?></a> / <?php echo(htmlspec($sl->author_name)); ?>
			<div class="upd">最后更新于：<?php echo($sl->update_time); ?></div>
		</td>
		<td class="oper"><a href="javascript:;" rel="d_<?php echo($sl->entry_id); ?>"><img alt="" src="/img/delete.png" /></a></td>
	</tr>
	<?php } ?>
</table>
